package com.example;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create with Intellij idea
 * User:鲁智明
 * Date:2018/11/16
 * Time:22:46
 */
@SpringBootApplication
@RestController
@EnableDiscoveryClient  //如果注册中心不是eureka，则使用@EnableDiscoveryClient 注解 像注册中心上注册服务
public class ZkMemberApp {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/getMember")
    public String getMember(){
        return "会员服务,订单服务调用会员服务,端口号:"+serverPort;
    }

    public static void main(String[] args) {
        SpringApplication.run(ZkMemberApp.class,args);
    }
}
